import request from '@/utils/request'

function treeData () {
  return request({
    url: '/area/tree',
    method: 'get'
  });
}

function addArea (data) {
  return request({
    url: '/area/add',
    method: 'post',
    data
  });
}

function editArea (data) {
  return request({
    url: '/area/update',
    method: 'post',
    data
  });
}

function delArea (id) {
  return request({
    url: '/area/delete',
    method: 'get',
    params: {
      id: id
    }
  });
}

function getById (id) {
  return request({
    url: '/area/detail',
    method: 'get',
    params: {
      id: id
    }
  });
}

export {
  treeData,
  addArea,
  editArea,
  delArea,
  getById
}
